<template>
   <div class="types">
      <div class="header-types">
          新增保险产品分类
      </div>
  <el-form ref="form" :model="types" label-width="100px">
   <el-form-item label="保险新分类">
      <el-input v-model="types.typesName" class="addTypes"></el-input>
   </el-form-item>
  <el-form-item>
    <el-button type="primary" @click="addTypes1(types)">立即新增</el-button>
    <el-button>取消</el-button>
  </el-form-item>
</el-form>
   </div>
</template>



<script>
import { createNamespacedHelpers } from "vuex";
const { mapActions} = createNamespacedHelpers("types");

// import axios from 'axios'

    export default {
    data() {
      return {
        types: {
          typesName: '',
        }
      }
    },
    methods:{
        ...mapActions(['addTypes']),

       async addTypes1(types){
         let data = await this.addTypes(types)
          this.$message({
            message:'新增成功',
            type:'success'
          });
        }    
    }
  }

</script>

<style scoped>
   .addTypes{
      width: 20%;
   }
   .header-types{
      margin: 20px 30px 30px 20px;
      height: 30px;
      font-size: 20px;
      color: rgb(109, 109, 109);
   }
</style>